<template>
    <div id="app">
      <el-form ref="add-Address" :model="address" label-width="100px">
        <el-form-item label="收货人">
          <el-input v-model="address.receiveName" ></el-input>
        </el-form-item>
        <el-form-item label="收货地址">
          <el-input v-model="address.address" ></el-input>
        </el-form-item>
        <el-form-item label="电话">
          <el-input v-model="address.mobile" ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="saveAddress()">提交</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
      data(){
        return {
          address:{},
        }
      },
      methods:{
        saveAddress(){
          //发出ajax请求
          this.axios.post("/address/add",this.address).then((resp)=>{
            this.$router.push("/cart/MyAddress");
          })
        }
      }
    }
</script>


<style scoped>

</style>
